//
// Created by Administrator on 24-8-10.
//
#include "start.h"
#include "main.h"
#include "usart.h"
#include <string>
#include "../Beep/Beep.h"
#include "../Flame/Flame.h"
#include "../W25QXX/W25QXXClass.h"
#include "../W25QXX/W25QXX.h"
#include <cstring>
using namespace std;

#define W25QXX

void startup()
{
#ifdef  FLAME
    string str = "hello world!";
    Beep beep(BEEP_GPIO_Port,BEEP_Pin);
    Flame flame(Flame_GPIO_Port,Flame_Pin);
#endif

#ifdef W25QXX
    W25QXXClass w;
    w.TestReadWrite();
#endif

    while(1)
    {
#ifdef  FLAME
        if(flame.FlameCheck()==STATE::DANGER){
           //
            beep.BeepOff();
        }else{
           //
            beep.BeepOn();
        }
        //beep.BeepWarning(2000);
        //        HAL_Delay(1000);
        //        HAL_UART_Transmit(&huart1,(uint8_t *)str.data(),str.size(),0xff);
        //
        //        HAL_GPIO_TogglePin(LED_GPIO_Port,LED_Pin);
#endif
    }
}

